import { hasPermission } from '@/directives/permission'
// 文章管理列表表头定义
export const ARTICLE_MANAGE_COLUMNS = [
  {
    name: '标题',
    key: 'articleTitle',
    align: 'left',
    width: 200,
    showOverflowTooltip: true
  },
  {
    name: '所属用户',
    key: 'nickname',
    width: 150,
    showOverflowTooltip: true
  },
  {
    name: '所属分类',
    key: 'category',
    width: 150,
    slot: 'category'
  },
  {
    name: '标签',
    key: 'tag',
    slot: 'tag',
    width: 350,
    showOverflowTooltip: true
  },
  {
    name: '封面',
    key: 'coverImage',
    width: 100,
    slot: 'coverImage'
  },
  {
    name: '描述信息',
    key: 'description',
    width: 300,
    showOverflowTooltip: true
  },
  {
    name: '参考链接',
    key: 'linkUrl',
    width: 200,
    showOverflowTooltip: true
  },
  {
    name: '状态',
    key: 'status',
    width: 130,
    slot: 'status'
  },
  {
    name: '代码高亮样式',
    key: 'codeStyle',
    width: 180
  },
  {
    name: '主题样式',
    key: 'theme',
    width: 200,
    showOverflowTooltip: true
  },
  {
    name: '创建时间',
    key: 'createTime',
    width: 180
  },
  {
    name: '更新时间',
    key: 'updateTime',
    width: 180
  },
  {
    name: '浏览次数',
    key: 'viewCounts'
  },
  {
    name: '收藏次数',
    key: 'collectCounts'
  },
  {
    name: '点赞次数',
    key: 'likeCounts'
  },
  {
    name: '操作',
    key: 'operate',
    fixed: 'right',
    width: 130,
    slot: 'operate',
    hidden: !hasPermission([
      'article-manage-permission:btn:delete',
      'article-manage-permission:btn:approve',
      'article-manage-permission:btn:approve-again'
    ])
  }
].filter(o => !o.hidden)

// 友圈管理列表表头定义
export const CIRCLE_MANAGE_COLLUMNS = [
  {
    name: '内容',
    key: 'content',
    fixed: 'left',
    align: 'left',
    showOverflowTooltip: true
  },
  {
    name: '图片',
    key: 'picList',
    slot: 'picList',
    width: 300
  },
  {
    name: '所属用户',
    key: 'nickname',
    width: 200
  },
  {
    name: '点赞数量',
    key: 'likeCounts',
    width: 120
  },
  {
    name: '评论数量',
    key: 'commentCounts',
    width: 120
  },
  {
    name: '发布时间',
    key: 'createTime',
    width: 180
  },
  {
    name: '操作',
    key: 'operate',
    fixed: 'right',
    width: 100,
    slot: 'operate',
    hidden: !hasPermission('circle-manage-permission:btn:delete')
  }
].filter(o => !o.hidden)

// 反馈管理列表表头定义
export const FEEDBACK_MANAGE_COLLUMNS = [
  {
    name: '内容',
    key: 'content',
    fixed: 'left',
    align: 'left',
    showOverflowTooltip: true
  },
  {
    name: '发布时间',
    key: 'createTime',
    width: 180
  },
  {
    name: '所属用户',
    key: 'nickname',
    width: 160
  },
  {
    name: '👍',
    key: 'likeCount',
    width: 60
  },
  {
    name: '👎',
    key: 'dislikeCount',
    width: 60
  },
  {
    name: '🎉',
    key: 'giftCount',
    width: 60
  },
  {
    name: '❤️',
    key: 'heartCount',
    width: 60
  },
  {
    name: '🚀',
    key: 'rocketCount',
    width: 60
  },
  {
    name: '👀',
    key: 'viewCount',
    width: 60
  },
  {
    name: '操作',
    key: 'operate',
    fixed: 'right',
    width: 100,
    slot: 'operate',
    hidden: !hasPermission('feedback-manage-permission:btn:delete')
  }
].filter(o => !o.hidden)

// 思维导图列表表头定义
export const XMIND_COLUMNS = [
  {
    name: '思维导图名称',
    key: 'name',
    fixed: 'left',
    align: 'left',
    showOverflowTooltip: true
  },
  {
    name: '缩略图',
    key: 'cover',
    slot: 'cover',
    width: 180
  },
  {
    name: '所属用户',
    key: 'nickname'
  },
  {
    name: '是否被推荐',
    key: 'recommend',
    slot: 'recommend'
  },
  {
    name: '发布时间',
    key: 'createTime',
    width: 180
  },
  {
    name: '更新时间',
    key: 'updateTime',
    width: 180
  },
  {
    name: '操作',
    key: 'operate',
    fixed: 'right',
    width: 120,
    slot: 'operate',
    hidden: !hasPermission('xmind-permission:btn:recommend')
  }
].filter(o => !o.hidden)
